package com.lyl.servicesms.config;

import com.zhenzi.sms.ZhenziSmsClient;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * 常量类，读取配置文件application.properties中的配置
 */
@Configuration
public class SmsConfig  {


    ZhenziSmsClient client = new ZhenziSmsClient("", "", "");

    @Value("${zzy.sms.file.apiUrl}")
    private String apiUrl;
    @Value("${zzy.sms.file.appId}")
    private String appId;


    @Value("${zzy.sms.file.keySecret}")
    private String appSecret;

    @Bean
    public ZhenziSmsClient client(){
        return  new ZhenziSmsClient(apiUrl, appId, appSecret);

    }

}